package net.csiit.platform.codeguard.spring.classreading;

import org.springframework.core.io.DefaultResourceLoader;
import org.springframework.core.io.Resource;

public class DecryptResourceLoader extends DefaultResourceLoader {

    public DecryptResourceLoader() {
    }

    public DecryptResourceLoader(ClassLoader classLoader) {
        super(classLoader);
    }

    @Override
    public Resource getResource(String location) {
        Resource resource = super.getResource(location);
        if (resource != null) {
            return DecryptResourceWrapper.getResource(resource);
        }

        return resource;
    }
}
